package jdbc;

import com.sun.org.apache.bcel.internal.generic.ACONST_NULL;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class Demo11 {
    public static void main(String[] args) {
        try (Connection con=DBUtil.getConnection();){
            String sql="DELETE FROM user WHERE username=?";
            PreparedStatement pre=con.prepareStatement(sql);
            pre.setString(1,"齐静春");
            int num=pre.executeUpdate();
            System.out.println(num>0?"删除成功":"删除失败");
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
